Auto merge of #2534 - alexcrichton:lock-with-git-repos, r=brson
authorbors <bors@rust-lang.org>
Sat, 2 Apr 2016 23:26:03 +0000 (16:26 -0700)
committerbors <bors@rust-lang.org>
Sat, 2 Apr 2016 23:26:03 +0000 (16:26 -0700)
commitdb60a097672eb035cb62b2384975ca01a78c1235
treea883798aeaa40558b1fb449a1b97d24265dd8df6
parent72690ba226f3b6a47196441eef196836ae1fca0d
parent18e593044d900236d4079b06902dd6bbfb2c4456
Auto merge of #2534 - alexcrichton:lock-with-git-repos, r=brson

Replace existing sources before updating

Currently sources may acquire file locks to ensure that they're not tampered
with while they're in use. We may load two sources to the same location,
however, in the case of git repositories which need to be updated. Cargo will
first load a locked version of the source and then may load an unlocked version,
and these two loads currently deadlock.

This commit tweaks the logic when updating a source to only update it after the
previous source has been replaced.

Closes #2533